package com.wrk._1_语法._04_循环._01_单循环;

import java.util.Scanner;

public class _001_依次输入10个数输出最大值 {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        //定义变量
        int number;
        int max=0;
        //循环输入10个数字
        for (int i=1; i<=10;i++){
            System.out.println("请输入第"+i+"个数:");
            number = scanner.nextInt();
            if (number>=0) {
                if (number>max) {
                    max = number;
                }
            }
            if (number<0) {
                if (number>max) {
                    max = number;
                }
            }
        }
        System.out.println("最大值为:"+max);
        scanner.close();
    }
}
